package cn.cdm.dao;

import cn.cdm.domain.MiaoshaUser;
import cn.cdm.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;


@Mapper  // 表明是一个映射层Mapper
public interface UserDao {
	
	@Select("select * from user where id = #{id}")
	User getById(@Param("id") int id);

	@Insert("insert into user(id, name) values(#{id}, #{name})")
	int insert(User user);

	@Insert("insert into miaosha_user values(#{id},#{nickname},#{password},#{salt},#{head},#{registerDate},#{lastLoginDate},#{loginCount})")
	int insertAll(MiaoshaUser user);
	
}
